from django.shortcuts import render
from django.core.paginator import Paginator
from rest_framework.decorators import api_view
from django.http import JsonResponse
from .models import Notification
from rest_framework.parsers import JSONParser
# Create your views here.
@api_view(['GET'])
def select(request):
    publish_time=request.GET.get('publish_time')
    print(publish_time)
    # list={}
    # if publish_time =='' and publish_time!=None:
    #     list['publish_time']=publish_time
    notification=Notification.objects.filter().values()
    data=[]
    for i in notification:
        data.append(i)
    return JsonResponse({"code":200,"massage":"查询成功","data":data})